package com.sky.controller.user;

import com.sky.result.Result;
import com.sky.service.UserDishService;
import com.sky.service.UserSetmealService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/setmeal")
public class UserSetmealController {
	
	private final UserDishService userDishService;
	
	private final UserSetmealService userSetmealService;
	
	public UserSetmealController(UserDishService userDishService, UserSetmealService userSetmealService) {
		this.userDishService = userDishService;
		this.userSetmealService = userSetmealService;
	}
	
	@GetMapping("/list")
	public Result setmealList(Long categoryId) {
		return userSetmealService.list(categoryId);
	}
	
	@GetMapping("/dish/{id}")
	public Result dishListInSetmeal(@PathVariable Long id) {
		return userDishService.userDishService(id);
	}
}
